package server;

/**
 * @author lbq
 * @version 1.0
 * @date 2021/1/21 21:23
 */
public class HttpProtocolUtil {

    public static String getHttpHeader200(long contentLength) {
        return "HTTP/1.1 200 OK \n" +
                "Content-Type: text/html \n" +
                "Content-Length: " + contentLength + "\n" +
                "\r\n";
    }

    public static String getHttpHeader404() {
        String msg = "<h1>404 NOT FOUND</h1>";
        return "HTTP/1.1 404 NOT FOUND \n" +
                "Content-Type: text/html \n" +
                "Content-Length: " + msg.length() + "\n" +
                "\r\n" + msg;
    }
}
